<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ page import="com.scalar.chiptrack.sales.forms.quote.ApproverQuotationForm,com.scalar.chiptrack.utils.ConfigManager"%>
<%@ page import="com.scalar.chiptrack.utils.ISubAction" %>
<%@ page import="com.scalar.chiptrack.commons.SessionKeys" %>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<%
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<style type="text/css">
a { text-decoration : none}
</style>
<script language="javaScript">
    function closeWindow(form)
    {
        window.close();
    }
     function sortResults( colName, sortOrder )
     {
           var form = document["previousQuotationsDetailsSearchForm"];
           form["resultBean.sortColumn"].value = colName;
           form["resultBean.sortOrder"].value = sortOrder;
           form["subAction"].value = '<%= ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_DETAILS_SEARCH_SORT %>';
           form.action="<%= request.getContextPath() %>/previousQuotationsDetailsSearch.do?subAction=<%= ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_DETAILS_SEARCH_SORT %>";
           form.target="_self";
           form.submit();
     }
     function onScroll( scrollType )
    {
        var form = document["previousQuotationsDetailsSearchForm"];
        form.action="<%= request.getContextPath() %>/previousQuotationsDetailsSearch.do?subAction=<%= ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_DETAILS_SEARCH_SCROLL %>&scrollAction="+scrollType;
        form.target="_self";
        form.submit();
    }
    function onGoTo( dropDown )
    {
         var form = document["previousQuotationsDetailsSearchForm"];
         var pageNo = dropDown.options[dropDown.selectedIndex].value;
         form.action="<%= request.getContextPath() %>/previousQuotationsDetailsSearch.do?subAction=<%= ISubAction.CHIPTRAC_PREVIOUS_QUOTATION_DETAILS_SEARCH_SCROLL %>&scrollAction=<%= ISubAction.RESULT_SCROLL_GOTO_ACTION %>&currentPageNo="+pageNo;
         form.target="_self";
         form.submit();
    }
</script>
</HEAD>

<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >
<html:form action="/previousQuotationsDetailsSearch.do" method="POST" >
    <% String formName = "previousQuotationsDetailsSearchForm"; %>
<table width="98%" cellspacing='0' cellpadding='0' border="0" align=center>
    <tr>
        <td colspan="3" align="center" class="NArialL">
                <h4> Previous Quotations Details </h4>
        </td>
    </tr>
    <html:hidden name="<%=formName%>" property="subAction"/>
    <html:hidden name="<%=formName%>" property="scrollAction"/>
    <html:hidden name="<%=formName%>" property="resultBean.sortColumn" />
    <html:hidden name="<%=formName%>" property="resultBean.sortOrder" />
    <tr><td colspan=3><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=3></td></tR>
    <tr><td colspan=3 align="right"> <a href="javascript:closeWindow(<%= formName %>);" onMouseOver="window.status='Click here to close this window';return true" onmouseout="window.status='';return true" ><font class='NArialL'>Close</font></a></td></tr>
    <logic:present name="<%= SessionKeys.SEARCH_RESULTS %>">
        <tr>
            <td colspan="3">
                <chiptrack:searchResults formName="<%=formName%>"/>
            </td>
        </tr>
        <TR>
            <logic:present name="<%= formName %>">
               <TD width="100%" class="msg" align="center">
                 <a <logic:equal name="<%= SessionKeys.SEARCH_RESULTS %>" property="isFirstPage" value="false"> href="javascript:onScroll('<%= ISubAction.RESULT_SCROLL_FIRST_ACTION %>')" </logic:equal> class="NArialL"
                     onmouseover="window.status='First page';return true"
                     onmouseout="window.status='';return true">
                    <<
                 </a>&nbsp;&nbsp;
                 <a <logic:equal name="<%= SessionKeys.SEARCH_RESULTS  %>" property="isFirstPage" value="false"> href="javascript:onScroll('<%= ISubAction.RESULT_SCROLL_PREVIOUS_ACTION %>')" </logic:equal> class="NArialL"
                     onmouseover="window.status='Previous page';return true"
                     onmouseout="window.status='';return true">
                    <
                 </a>
                 <a <logic:equal name="<%= SessionKeys.SEARCH_RESULTS  %>" property="isLastPage" value="false"> href="javascript:onScroll('<%= ISubAction.RESULT_SCROLL_NEXT_ACTION %>')" </logic:equal> class="NArialL"
                     onmouseover="window.status='Next page';return true"
                     onmouseout="window.status='';return true">
                    >
                 </a>
                 <a <logic:equal name="<%= SessionKeys.SEARCH_RESULTS  %>" property="isLastPage" value="false"> href="javascript:onScroll('<%= ISubAction.RESULT_SCROLL_LAST_ACTION %>')" </logic:equal> class="NArialL"
                     onmouseover="window.status='Last Page';return true"
                     onmouseout="window.status='';return true">
                    >>
                 </a>
                 <input type="hidden" name="pageNoInRequest" value='<bean:write name="<%= formName %>" property="currentPageNo" />' />
                <%--(<bean:write name="<%=formName%>" property="currentPageNo" />)--%>
                 <font class="NArialL"> Go To  </font>
                 <html:select name="<%=formName%>" property="currentPageNo"  onchange="onGoTo(this)"   styleClass="NArialL" >
                   <html:options name="<%=formName%>" property="pageNumbers" />
                 </html:select>

                    <font class="NArialL"> &nbsp; Of &nbsp;(<bean:write name="<%=formName%>" property="paginator.numberOfPages" />)</font>
            </logic:present>
            </TD>
        </TR>
        </logic:present>
        <logic:notPresent name="<%= SessionKeys.SEARCH_RESULTS %>">
          <TR height="20" >
           <td colspan="5" align="center"></td>
          </tr>
          <TR height="20" >
           <td colspan="5" align="center"></td>
          </tr>
          <TR class='NArialL' height='18' align="center">
            <td colspan="5" align="center" width="*" >
            <center><font class="NArialL">Previous quotations details not found</font>

            </center></td>
          </tr>
          <TR height="20" >
           <td colspan="5" align="center"></td>
          </tr>
          </logic:notPresent>
    </table>
    </html:form>
    </BODY>
    </HTML>
